Skip to content

fix(ai-gateway): keep long response streams alive - #214

Merged
akua-agentos[bot] merged 1 commit into
mainfrom
fix/ai-gateway-stream-idle-timeout
Aug 8, 2026
Merged

fix(ai-gateway): keep long response streams alive#214
akua-agentos[bot] merged 1 commit into
mainfrom
fix/ai-gateway-stream-idle-timeout

Conversation

@akua-agentos

@akua-agentos akua-agentos Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add bounded AI_GATEWAY_IDLE_TIMEOUT_SECONDS configuration
  • default to Bun's maximum supported idle timeout of 255 seconds
  • accept the complete supported 0..255 range (0 disables the timeout)
  • propagate the setting to BunHttpServer.layer({ idleTimeout })

Root cause

A production-like read-only scout wave using gpt-5.6-sol exposed Bun's 10-second default request idle timeout. Long reasoning gaps caused Bun.serve() timeout warnings followed by transport ECONNRESET, even though the upstream model request was otherwise healthy.

Verification

  • targeted configuration/CLI tests: 11 passed
  • full AI Gateway suite: 21 files, 88 tests passed
  • TypeScript check passed
  • Effect migration policy: 509 paths, no violations
  • @akua-dev/agentos package build passed
  • git diff --check passed
  • independent pre-commit review: no security concerns, logic errors, or suggestions

Operational note

This PR changes source defaults only. It does not deploy, resume the historical Fleet, alter credentials, or modify production.

Refs #85

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
agentos-site f095209 Commit Preview URL

Branch Preview URL
Aug 08 2026, 04:52 PM

@akua-agentos
akua-agentos Bot merged commit fd4b5f6 into main Aug 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants